//
//  DirectionMPMoviePlayerViewController.m
//  UESTCPioneer
//
//  Created by Apple on 14-6-12.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "DirectionMPMoviePlayerViewController.h"

@interface DirectionMPMoviePlayerViewController ()

@end

@implementation DirectionMPMoviePlayerViewController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIDeviceOrientationIsLandscape(interfaceOrientation);
}

@end
/*
 - (void)viewDidLoad
 {
 [super viewDidLoad];
 // Do any additional setup after loading the view from its nib.
 [self customTitleView];
 NSString *mystr = @"http://114.112.50.220:8080/res/20120331/2FFCE63A-C997-4D8C-4C4F-4127D78A958E.m3u8";
 NSURL *myURL = [[NSURL alloc] initWithString:mystr];
 [self playMovieAtURL:myURL];
 }
 
 -(void)playMovieAtURL:(NSURL*)theURL
 {
 playerView = [[DirectionMPMoviePlayerViewController alloc] initWithContentURL:theURL];
 playerView.view.frame = self.view.frame;//全屏播放（全屏播放不可缺）
 playerView.moviePlayer.scalingMode = MPMovieScalingModeAspectFill;//全屏播放（全屏播放不可缺）
 [[NSNotificationCenter defaultCenter] addObserver:self
 selector:@selector(myMovieFinishedCallback:)
 name:MPMoviePlayerPlaybackDidFinishNotification
 object:playerView];
 [playerView.moviePlayer play];
 [self presentMoviePlayerViewControllerAnimated:playerView];
 }
 
 // When the movie is done, release the controller.
 -(void)myMovieFinishedCallback:(NSNotification*)aNotification
 {
 DirectionMPMoviePlayerViewController* theMovie = [aNotification object];
 [[NSNotificationCenter defaultCenter] removeObserver:self
 name:MPMoviePlayerPlaybackDidFinishNotification
 object:theMovie];
 
 [theMovie release];
 }
 */